package com.yjd.comm.funds.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * Created by yjd-wap on 2017/9/20.
 */
public enum PayChannelEnum {

    LLPAY(1, "llpay", "连连");

    private int channel;

    private String code;

    private String desc;

    private PayChannelEnum(int channel, String code, String desc) {
        this.channel = channel;
        this.code = code;
        this.desc = desc;
    }

    public static PayChannelEnum parse(String channel) {
        if (StringUtils.isBlank(channel)) {
            return null;
        }
        for (PayChannelEnum payChannel : PayChannelEnum.values()) {
            if (channel.equals(payChannel.getCode())) {
                return payChannel;
            }
        }
        return null;
    }

    public int getChannel() {
        return channel;
    }

    public void setChannel(int channel) {
        this.channel = channel;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
